home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / Dialogs.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  17.1 KB  |  591 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Dialogs.a
  3. ;
  4. ;    Contains:    Dialog Manager interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1985-1997 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  19. __DIALOGS__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  25.     include 'MixedMode.a'
  26.     ENDIF
  27.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  28.     include 'Events.a'
  29.     ENDIF
  30.     IF &TYPE('__MACWINDOWS__') = 'UNDEFINED' THEN
  31.     include 'MacWindows.a'
  32.     ENDIF
  33.     IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
  34.     include 'TextEdit.a'
  35.     ENDIF
  36.  
  37.  
  38.                                                             ; new, more standard names for dialog item types
  39. kControlDialogItem                EQU        4
  40. kButtonDialogItem                EQU        4
  41. kCheckBoxDialogItem                EQU        5
  42. kRadioButtonDialogItem            EQU        6
  43. kResourceControlDialogItem        EQU        7
  44. kStaticTextDialogItem            EQU        8
  45. kEditTextDialogItem                EQU        16
  46. kIconDialogItem                    EQU        32
  47. kPictureDialogItem                EQU        64
  48. kUserDialogItem                    EQU        0
  49. kItemDisableBit                    EQU        128
  50.  
  51.                                                             ; old names for dialog item types
  52. ctrlItem                        EQU        4
  53. btnCtrl                            EQU        0
  54. chkCtrl                            EQU        1
  55. radCtrl                            EQU        2
  56. resCtrl                            EQU        3
  57. statText                        EQU        8
  58. editText                        EQU        16
  59. iconItem                        EQU        32
  60. picItem                            EQU        64
  61. userItem                        EQU        0
  62. itemDisable                        EQU        128
  63.  
  64.                                                             ; standard dialog item numbers
  65. kStdOkItemIndex                    EQU        1
  66. kStdCancelItemIndex                EQU        2                    ; old names
  67. ok                                EQU        1
  68. cancel                            EQU        2
  69.  
  70.                                                             ; standard icon resource id's     
  71. kStopIcon                        EQU        0
  72. kNoteIcon                        EQU        1
  73. kCautionIcon                    EQU        2                    ; old names
  74. stopIcon                        EQU        0
  75. noteIcon                        EQU        1
  76. cautionIcon                        EQU        2
  77.  
  78.  
  79.     IF OLDROUTINENAMES THEN
  80.  
  81. ;   These constants lived briefly on ETO 16.  They suggest
  82. ;   that there is only one index you can use for the OK 
  83. ;   item, which is not true.  You can put the ok item 
  84. ;   anywhere you want in the DITL.
  85.  
  86.  
  87.  
  88. kOkItemIndex                    EQU        1
  89. kCancelItemIndex                EQU        2
  90.     ENDIF    ; OLDROUTINENAMES
  91. ;     Dialog Item List Manipulation Constants    
  92. ; typedef SInt16                         DITLMethod
  93.  
  94.  
  95. overlayDITL                        EQU        0
  96. appendDITLRight                    EQU        1
  97. appendDITLBottom                EQU        2
  98. ; typedef SInt16                         StageList
  99.  
  100. ;  DialogRef is obsolete. Use DialogPtr instead.
  101. ; typedef DialogPtr                     DialogRef
  102.  
  103. DialogRecord            RECORD 0
  104. window                     ds        WindowRecord    ; offset: $0 (0)
  105. items                     ds.l    1                ; offset: $9C (156)
  106. textH                     ds.l    1                ; offset: $A0 (160)
  107. editField                 ds.w    1                ; offset: $A4 (164)
  108. editOpen                 ds.w    1                ; offset: $A6 (166)
  109. aDefItem                 ds.w    1                ; offset: $A8 (168)
  110. sizeof                     EQU *                    ; size:   $AA (170)
  111.                         ENDR
  112. ; typedef struct DialogRecord *            DialogPeek
  113.  
  114. DialogTemplate            RECORD 0
  115. boundsRect                 ds        Rect            ; offset: $0 (0)
  116. procID                     ds.w    1                ; offset: $8 (8)
  117. visible                     ds.b    1                ; offset: $A (10)
  118. filler1                     ds.b    1                ; offset: $B (11)
  119. goAwayFlag                 ds.b    1                ; offset: $C (12)
  120. filler2                     ds.b    1                ; offset: $D (13)
  121. refCon                     ds.l    1                ; offset: $E (14)
  122. itemsID                     ds.w    1                ; offset: $12 (18)
  123. title                     ds        Str255            ; offset: $14 (20)
  124. sizeof                     EQU *                    ; size:   $114 (276)
  125.                         ENDR
  126. ; typedef struct DialogTemplate *        DialogTPtr
  127.  
  128. ; typedef DialogTPtr *                    DialogTHndl
  129.  
  130. AlertTemplate            RECORD 0
  131. boundsRect                 ds        Rect            ; offset: $0 (0)
  132. itemsID                     ds.w    1                ; offset: $8 (8)
  133. stages                     ds.w    1                ; offset: $A (10)
  134. sizeof                     EQU *                    ; size:   $C (12)
  135.                         ENDR
  136. ; typedef struct AlertTemplate *        AlertTPtr
  137.  
  138. ; typedef AlertTPtr *                    AlertTHndl
  139.  
  140. ;  new type abstractions for the dialog manager 
  141. ; typedef SInt16                         DialogItemIndexZeroBased
  142.  
  143. ; typedef SInt16                         DialogItemIndex
  144.  
  145. ; typedef SInt16                         DialogItemType
  146.  
  147. ;  dialog manager callbacks 
  148.  
  149. ;    NOTE: Code running under MultiFinder or System 7.0 or newer
  150. ;    should always pass NULL to InitDialogs.
  151. ;
  152.  
  153. ;
  154. ; pascal void InitDialogs(void *ignored)
  155. ;
  156.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  157.         _InitDialogs:    OPWORD    $A97B
  158.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  159.         IMPORT_CFM_FUNCTION InitDialogs
  160.     ENDIF
  161.  
  162. ;
  163. ; pascal void ErrorSound(SoundUPP soundProc)
  164. ;
  165.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  166.         _ErrorSound:    OPWORD    $A98C
  167.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  168.         IMPORT_CFM_FUNCTION ErrorSound
  169.     ENDIF
  170.  
  171. ;
  172. ; pascal DialogPtr NewDialog(void *dStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, SInt16 procID, WindowPtr behind, Boolean goAwayFlag, SInt32 refCon, Handle items)
  173. ;
  174.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  175.         _NewDialog:    OPWORD    $A97D
  176.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  177.         IMPORT_CFM_FUNCTION NewDialog
  178.     ENDIF
  179.  
  180. ;
  181. ; pascal DialogPtr GetNewDialog(SInt16 dialogID, void *dStorage, WindowPtr behind)
  182. ;
  183.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  184.         _GetNewDialog:    OPWORD    $A97C
  185.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  186.         IMPORT_CFM_FUNCTION GetNewDialog
  187.     ENDIF
  188.  
  189. ;
  190. ; pascal DialogPtr NewColorDialog(void *dStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, SInt16 procID, WindowPtr behind, Boolean goAwayFlag, SInt32 refCon, Handle items)
  191. ;
  192.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  193.         _NewColorDialog:    OPWORD    $AA4B
  194.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  195.         IMPORT_CFM_FUNCTION NewColorDialog
  196.     ENDIF
  197.  
  198. ;
  199. ; pascal void CloseDialog(DialogPtr theDialog)
  200. ;
  201.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  202.         _CloseDialog:    OPWORD    $A982
  203.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  204.         IMPORT_CFM_FUNCTION CloseDialog
  205.     ENDIF
  206.  
  207. ;
  208. ; pascal void DisposeDialog(DialogPtr theDialog)
  209. ;
  210.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  211.         _DisposeDialog:    OPWORD    $A983
  212.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  213.         IMPORT_CFM_FUNCTION DisposeDialog
  214.     ENDIF
  215.  
  216. ;
  217. ; pascal void ModalDialog(ModalFilterUPP modalFilter, DialogItemIndex *itemHit)
  218. ;
  219.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  220.         _ModalDialog:    OPWORD    $A991
  221.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  222.         IMPORT_CFM_FUNCTION ModalDialog
  223.     ENDIF
  224.  
  225. ;
  226. ; pascal Boolean IsDialogEvent(const EventRecord *theEvent)
  227. ;
  228.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  229.         _IsDialogEvent:    OPWORD    $A97F
  230.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  231.         IMPORT_CFM_FUNCTION IsDialogEvent
  232.     ENDIF
  233.  
  234. ;
  235. ; pascal Boolean DialogSelect(const EventRecord *theEvent, DialogPtr *theDialog, DialogItemIndex *itemHit)
  236. ;
  237.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  238.         _DialogSelect:    OPWORD    $A980
  239.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  240.         IMPORT_CFM_FUNCTION DialogSelect
  241.     ENDIF
  242.  
  243. ;
  244. ; pascal void DrawDialog(DialogPtr theDialog)
  245. ;
  246.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  247.         _DrawDialog:    OPWORD    $A981
  248.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  249.         IMPORT_CFM_FUNCTION DrawDialog
  250.     ENDIF
  251.  
  252. ;
  253. ; pascal void UpdateDialog(DialogPtr theDialog, RgnHandle updateRgn)
  254. ;
  255.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  256.         _UpdateDialog:    OPWORD    $A978
  257.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  258.         IMPORT_CFM_FUNCTION UpdateDialog
  259.     ENDIF
  260.  
  261. ;
  262. ; pascal void HideDialogItem(DialogPtr theDialog, DialogItemIndex itemNo)
  263. ;
  264.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  265.         _HideDialogItem:    OPWORD    $A827
  266.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  267.         IMPORT_CFM_FUNCTION HideDialogItem
  268.     ENDIF
  269.  
  270. ;
  271. ; pascal void ShowDialogItem(DialogPtr theDialog, DialogItemIndex itemNo)
  272. ;
  273.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  274.         _ShowDialogItem:    OPWORD    $A828
  275.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  276.         IMPORT_CFM_FUNCTION ShowDialogItem
  277.     ENDIF
  278.  
  279. ;
  280. ; pascal DialogItemIndexZeroBased FindDialogItem(DialogPtr theDialog, Point thePt)
  281. ;
  282.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  283.         _FindDialogItem:    OPWORD    $A984
  284.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  285.         IMPORT_CFM_FUNCTION FindDialogItem
  286.     ENDIF
  287.  
  288. ;
  289. ; pascal DialogItemIndex Alert(SInt16 alertID, ModalFilterUPP modalFilter)
  290. ;
  291.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  292.         _Alert:    OPWORD    $A985
  293.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  294.         IMPORT_CFM_FUNCTION Alert
  295.     ENDIF
  296.  
  297. ;
  298. ; pascal DialogItemIndex StopAlert(SInt16 alertID, ModalFilterUPP modalFilter)
  299. ;
  300.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  301.         _StopAlert:    OPWORD    $A986
  302.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  303.         IMPORT_CFM_FUNCTION StopAlert
  304.     ENDIF
  305.  
  306. ;
  307. ; pascal DialogItemIndex NoteAlert(SInt16 alertID, ModalFilterUPP modalFilter)
  308. ;
  309.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  310.         _NoteAlert:    OPWORD    $A987
  311.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  312.         IMPORT_CFM_FUNCTION NoteAlert
  313.     ENDIF
  314.  
  315. ;
  316. ; pascal DialogItemIndex CautionAlert(SInt16 alertID, ModalFilterUPP modalFilter)
  317. ;
  318.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  319.         _CautionAlert:    OPWORD    $A988
  320.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  321.         IMPORT_CFM_FUNCTION CautionAlert
  322.     ENDIF
  323.  
  324. ;
  325. ; pascal void GetDialogItem(DialogPtr theDialog, DialogItemIndex itemNo, DialogItemType *itemType, Handle *item, Rect *box)
  326. ;
  327.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  328.         _GetDialogItem:    OPWORD    $A98D
  329.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  330.         IMPORT_CFM_FUNCTION GetDialogItem
  331.     ENDIF
  332.  
  333. ;
  334. ; pascal void SetDialogItem(DialogPtr theDialog, DialogItemIndex itemNo, DialogItemType itemType, Handle item, const Rect *box)
  335. ;
  336.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  337.         _SetDialogItem:    OPWORD    $A98E
  338.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  339.         IMPORT_CFM_FUNCTION SetDialogItem
  340.     ENDIF
  341.  
  342. ;
  343. ; pascal void ParamText(ConstStr255Param param0, ConstStr255Param param1, ConstStr255Param param2, ConstStr255Param param3)
  344. ;
  345.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  346.         _ParamText:    OPWORD    $A98B
  347.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  348.         IMPORT_CFM_FUNCTION ParamText
  349.     ENDIF
  350.  
  351. ;
  352. ; pascal void SelectDialogItemText(DialogPtr theDialog, DialogItemIndex itemNo, SInt16 strtSel, SInt16 endSel)
  353. ;
  354.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  355.         _SelectDialogItemText:    OPWORD    $A97E
  356.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  357.         IMPORT_CFM_FUNCTION SelectDialogItemText
  358.     ENDIF
  359.  
  360. ;
  361. ; pascal void GetDialogItemText(Handle item, Str255 text)
  362. ;
  363.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  364.         _GetDialogItemText:    OPWORD    $A990
  365.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  366.         IMPORT_CFM_FUNCTION GetDialogItemText
  367.     ENDIF
  368.  
  369. ;
  370. ; pascal void SetDialogItemText(Handle item, ConstStr255Param text)
  371. ;
  372.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  373.         _SetDialogItemText:    OPWORD    $A98F
  374.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  375.         IMPORT_CFM_FUNCTION SetDialogItemText
  376.     ENDIF
  377.  
  378. ;
  379. ; pascal SInt16 GetAlertStage(void)
  380. ;
  381.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  382.         Macro
  383.         _GetAlertStage        &dest=(sp)
  384.             move.w            $0A9A,&dest
  385.         EndM
  386.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  387.         IMPORT_CFM_FUNCTION GetAlertStage
  388.     ENDIF
  389.  
  390. ;
  391. ; pascal void SetDialogFont(SInt16 value)
  392. ;
  393.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  394.         Macro
  395.         _SetDialogFont        &src=(sp)+
  396.             move.w            &src,$0AFA
  397.         EndM
  398.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  399.         IMPORT_CFM_FUNCTION SetDialogFont
  400.     ENDIF
  401.  
  402. ;
  403. ; pascal void ResetAlertStage(void )
  404. ;
  405.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  406.         Macro
  407.         _ResetAlertStage
  408.             clr.w               $0A9A
  409.         EndM
  410.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  411.         IMPORT_CFM_FUNCTION ResetAlertStage
  412.     ENDIF
  413.  
  414.  
  415. ;
  416. ; pascal void AppendDITL(DialogPtr theDialog, Handle theHandle, DITLMethod method)
  417. ;
  418.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  419.         IMPORT_CFM_FUNCTION AppendDITL
  420.     ENDIF
  421.  
  422. ;
  423. ; pascal DialogItemIndex CountDITL(DialogPtr theDialog)
  424. ;
  425.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  426.         IMPORT_CFM_FUNCTION CountDITL
  427.     ENDIF
  428.  
  429. ;
  430. ; pascal void ShortenDITL(DialogPtr theDialog, DialogItemIndex numberItems)
  431. ;
  432.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  433.         IMPORT_CFM_FUNCTION ShortenDITL
  434.     ENDIF
  435.  
  436. ;
  437. ; pascal OSErr GetStdFilterProc(ModalFilterUPP *theProc)
  438. ;
  439.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  440.         Macro
  441.         _GetStdFilterProc
  442.             move.w              #$0203,D0
  443.             dc.w                $AA68
  444.         EndM
  445.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  446.         IMPORT_CFM_FUNCTION GetStdFilterProc
  447.     ENDIF
  448.  
  449. ;
  450. ; pascal OSErr SetDialogDefaultItem(DialogPtr theDialog, DialogItemIndex newItem)
  451. ;
  452.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  453.         Macro
  454.         _SetDialogDefaultItem
  455.             move.w              #$0304,D0
  456.             dc.w                $AA68
  457.         EndM
  458.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  459.         IMPORT_CFM_FUNCTION SetDialogDefaultItem
  460.     ENDIF
  461.  
  462. ;
  463. ; pascal OSErr SetDialogCancelItem(DialogPtr theDialog, DialogItemIndex newItem)
  464. ;
  465.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  466.         Macro
  467.         _SetDialogCancelItem
  468.             move.w              #$0305,D0
  469.             dc.w                $AA68
  470.         EndM
  471.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  472.         IMPORT_CFM_FUNCTION SetDialogCancelItem
  473.     ENDIF
  474.  
  475. ;
  476. ; pascal OSErr SetDialogTracksCursor(DialogPtr theDialog, Boolean tracks)
  477. ;
  478.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  479.         Macro
  480.         _SetDialogTracksCursor
  481.             move.w              #$0306,D0
  482.             dc.w                $AA68
  483.         EndM
  484.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  485.         IMPORT_CFM_FUNCTION SetDialogTracksCursor
  486.     ENDIF
  487.  
  488.     IF OLDROUTINENAMES THEN
  489.     ENDIF    ; OLDROUTINENAMES
  490. ;    *****************************************************************************
  491. ;    *                                                                           *
  492. ;    * The conditional STRICT_DIALOGS has been removed from this interface file. *
  493. ;    * The accessor macros to a DialogRecord are no longer necessary.            *
  494. ;    *                                                                           *
  495. ;    * All ≈Ref Types have reverted to their original Handle and Ptr Types.      *
  496. ;    *                                                                           *
  497. ;    *****************************************************************************
  498. ;
  499. ;    Details:
  500. ;    The original purpose of the STRICT_ conditionals and accessor macros was to
  501. ;    help ease the transition to Copland.  Shared data structures are difficult
  502. ;    to coordinate in a preemptive multitasking OS.  By hiding the fields in a
  503. ;    WindowRecord and other data structures, we would begin the migration to the
  504. ;    discipline wherein system data structures are completely hidden from
  505. ;    applications.
  506. ;    
  507. ;    After many design reviews, we finally concluded that with this sort of
  508. ;    migration, the system could never tell when an application was no longer
  509. ;    peeking at a WindowRecord, and thus the data structure might never become
  510. ;    system owned.  Additionally, there were many other limitations in the
  511. ;    classic toolbox that were begging to be addressed.  The final decision was
  512. ;    to leave the traditional toolbox as a compatibility mode.
  513. ;    
  514. ;    We also decided to use the Handle and Ptr based types in the function
  515. ;    declarations.  For example, NewWindow now returns a WindowPtr rather than a
  516. ;    WindowRef.  The Ref types are still defined in the header files, so all
  517. ;    existing code will still compile exactly as it did before.  There are
  518. ;    several reasons why we chose to do this:
  519. ;    
  520. ;    - The importance of backwards compatibility makes it unfeasible for us to
  521. ;    enforce real opaque references in the implementation anytime in the
  522. ;    foreseeable future.  Therefore, any opaque data types (e.g. WindowRef,
  523. ;    ControlRef, etc.) in the documentation and header files would always be a
  524. ;    fake veneer of opacity.
  525. ;    
  526. ;    - There exists a significant base of books and sample code that neophyte
  527. ;    Macintosh developers use to learn how to program the Macintosh.  These
  528. ;    books and sample code all use direct data access.  Introducing opaque data
  529. ;    types at this point would confuse neophyte programmers more than it would
  530. ;    help them.
  531. ;    
  532. ;    - Direct data structure access is used by nearly all Macintosh developers. 
  533. ;    Changing the interfaces to reflect a false opacity would not provide any
  534. ;    benefit to these developers.
  535. ;    
  536. ;    - Accessor functions are useful in and of themselves as convenience
  537. ;    functions, without being tied to opaque data types.  We will complete and
  538. ;    document the Windows and Dialogs accessor functions in an upcoming release
  539. ;    of the interfaces.
  540. ;
  541.  
  542.  
  543.  
  544. ;
  545. ; pascal void CouldDialog(SInt16 dialogID)
  546. ;
  547.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  548.         _CouldDialog:    OPWORD    $A979
  549.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  550.         IMPORT_CFM_FUNCTION CouldDialog
  551.     ENDIF
  552.  
  553. ;
  554. ; pascal void FreeDialog(SInt16 dialogID)
  555. ;
  556.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  557.         _FreeDialog:    OPWORD    $A97A
  558.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  559.         IMPORT_CFM_FUNCTION FreeDialog
  560.     ENDIF
  561.  
  562. ;
  563. ; pascal void CouldAlert(SInt16 alertID)
  564. ;
  565.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  566.         _CouldAlert:    OPWORD    $A989
  567.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  568.         IMPORT_CFM_FUNCTION CouldAlert
  569.     ENDIF
  570.  
  571. ;
  572. ; pascal void FreeAlert(SInt16 alertID)
  573. ;
  574.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  575.         _FreeAlert:    OPWORD    $A98A
  576.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  577.         IMPORT_CFM_FUNCTION FreeAlert
  578.     ENDIF
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.     ENDIF ; __DIALOGS__ 
  588.  
  589.